# common/exception/exception_enum.py
from enum import Enum


class BusiExceptionEnum(Enum):
    # 1001xxx 参数问题

    NO_FILE_PART = (1001001, "No file part")
    NO_SELECTED_FILE = (1001002, "No selected file")
    FILE_UPLOAD_ERROR = (1001003, "Error uploading file")
    INVALID_FILE_TYPE = (1001004, "Invalid file type")

    # 2001xxx oss业务异常
    OSS_FILE_RETRIEVAL_ERROR = (2001001, "Error retrieving file from OSS")
    OSS_FILE_UPLOAD_ERROR = (2001002, "Error uploading file to OSS")
    OSS_OBJECT_NOT_EXISTS = (2001003, "OSS object not exists")

    def __init__(self, code, message):
        self.code = code
        self.message = message

    def __str__(self):
        return f"{self.code}: {self.message}"
